'use strict';
 const db = uniCloud.database();

exports.main = async (event, context) => {
  //event为客户端上传的参数
  // console.log('event : ' + event)
  const collection = db.collection('users');
  let user_id=event.user_id;
    console.log(user_id);
  let res=await collection.doc(user_id).get();
  let lists=[];
  let focused_list=res.data[0].focused_users;
  for(let i=0; i<focused_list.length; i++){
	  let tmp=await collection.doc(focused_list[i]).get();
	  let focuser=tmp.data[0];
	  lists.push(focuser);
  }
 

  //返回数据给客户端
  return {"status":2, "lists":lists}
};